<?php

// +----------------------------------------------------------------------
// |产品分类model
// +----------------------------------------------------------------------
namespace app\admin\Model;

use think\Model;

class CategoModel extends Model{
   
    // 表名
    protected $name = 'Catego';
    // 表主键
    protected $pk = 'id';

    // 获取所有有效产品分类数据
    public function getActiveStatus($field='catepubid as id,pubnameCn as name')
    {
        $data=$this->where('valid', 1)->field($field)->select()->toArray();
        return array_column($data,null,'id');
    }
    
    // 获取所有有效产品分类数据
    public function getActivelist()
    {
        $data=$this->field('catepubid as id,pubnameCn as name')->select()->toArray();
        return array_column($data,null,'id');
    }
   
}

